package com.example.fashionshoes.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.example.fashionshoes.exception.BusinessException;
import com.example.fashionshoes.pojo.po.Coupon;
import com.example.fashionshoes.pojo.vo.CouponVO;

import java.util.List;

public interface CouponService extends IService<Coupon> {

    /**
     * 获取要售出的优惠劵
     * @return 售出的优惠劵
     */
    CouponVO getCoupon();

    /**
     * 优惠劵秒杀
     * @param id 秒杀优惠劵id
     * @return 购买结果
     */
    Boolean payCoupon(Integer id) throws BusinessException;

    /**
     * 获取商品可用的优惠劵
     * @return 优惠劵集合
     */
    List<Coupon> getLimitCoupon(Integer goodsId);
}
